/*
* 输入身份证号
* */

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:frametrim/utility/sq_color.dart';

class TextFieldIDCard extends StatelessWidget {
  //hite文本
  late String hiteText;

  TextEditingController _controller = TextEditingController();

  TextFieldIDCard(this.hiteText, this._controller);

  @override
  Widget build(BuildContext context) {
    return TextField(
        maxLength: 18,
        //键盘样式
        keyboardType: TextInputType.number,
        controller: _controller,
        //输入限制
        inputFormatters: [
          FilteringTextInputFormatter.allow(RegExp("[a-zA-Z]|[0-9]"))
        ],
        decoration: InputDecoration(
          // 去除输入框底部的字符计数,例如11/20
          counterText: '',

          /*去掉下划线*/
          // border: InputBorder.none,

          //contentPadding+border 设置TextField垂直居中
          contentPadding: EdgeInsets.symmetric(vertical: 0),
          border: OutlineInputBorder(borderSide: BorderSide.none),

          hintText: hiteText,
          hintStyle: TextStyle(fontSize: 15, color: SQColor.color_aeaeae),
          labelStyle: TextStyle(fontSize: 15, color: SQColor.black),
        ));
  }
}
